/* ============================================
   现代扁平化设计样式
   ============================================ */

/* 全局配置 */
.root {
    -fx-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans CN", "WenQuanYi Micro Hei", "Segoe UI", "Helvetica Neue", sans-serif;
    -fx-font-size: 13px;
    -fx-font-smoothing-type: lcd;
    -fx-background-color: #f5f5f7;
    -fx-text-fill: #3c3c3c;
}

/* 字体样式 */
.chinese-text {
    -fx-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "SimHei", "SF Pro Display", sans-serif;
}

.monospace {
    -fx-font-family: "SF Mono", "Consolas", "Monaco", "Menlo", "Courier New", monospace;
}

.title {
    -fx-font-weight: 600;
    -fx-font-size: 14px;
}

.bold-text {
    -fx-font-weight: 600;
    -fx-text-fill: #3c3c3c;
}

.small-text {
    -fx-font-size: 12px;
    -fx-text-fill: #999999;
}

.hint-text {
    -fx-font-size: 12px;
    -fx-text-fill: #007aff;
}

.large-text {
    -fx-font-size: 15px;
}

/* ============================================
   扁平化按钮 - 全局统一样式
   ============================================ */
.button {
    -fx-background-color: #ffffff;
    -fx-background-radius: 6;
    -fx-border-radius: 6;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-padding: 6 14 8 14;
    -fx-text-fill: #3c3c3c;
    -fx-cursor: hand;
    -fx-effect: null;
    -fx-font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    -fx-font-size: 13px;
    -fx-min-height: 32px;
    -fx-pref-height: 32px;
    -fx-alignment: center;
    -fx-content-display: center;
    -fx-background-insets: 0;
    -fx-border-insets: 0;
}

/* 按钮内部文本标签 */
.button > .label {
    -fx-padding: 0;
    -fx-translate-y: 0;
}

.button:hover {
    -fx-background-color: #f5f5f7;
    -fx-border-color: #b0b0b5;
}

.button:pressed {
    -fx-background-color: #e8e8ed;
}

.button:disabled {
    -fx-opacity: 0.4;
}

/* 主要操作按钮 */
.button-primary {
    -fx-background-color: #007aff;
    -fx-border-color: #007aff;
    -fx-text-fill: white;
}

.button-primary:hover {
    -fx-background-color: #0051d5;
    -fx-border-color: #0051d5;
}

.button-primary:pressed {
    -fx-background-color: #003d99;
}

/* 危险操作按钮 */
.button-danger {
    -fx-background-color: #ff3b30;
    -fx-border-color: #ff3b30;
    -fx-text-fill: white;
}

.button-danger:hover {
    -fx-background-color: #d32f2f;
}

/* ============================================
   扁平化输入框
   ============================================ */
.text-field {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-padding: 8 12 8 12;
    -fx-text-fill: #3c3c3c;
    -fx-effect: null;
}

.text-field:focused {
    -fx-border-color: #007aff;
    -fx-border-width: 2;
}

.text-area {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-text-fill: #3c3c3c;
}

.text-area:focused {
    -fx-border-color: #007aff;
    -fx-border-width: 2;
}

/* ============================================
   扁平化列表和树
   ============================================ */
.list-view, .tree-view {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-effect: null;
}

.list-cell, .tree-cell {
    -fx-background-color: transparent;
    -fx-text-fill: #3c3c3c;
    -fx-padding: 6 8 6 8;
}

.list-cell:hover, .tree-cell:hover {
    -fx-background-color: #f5f5f7;
}

.list-cell:selected, .tree-cell:selected {
    -fx-background-color: #007aff;
    -fx-text-fill: white;
}

.tree-view:focused .tree-cell:selected {
    -fx-background-color: #007aff;
}

/* ============================================
   扁平化标签页
   ============================================ */
.tab-pane {
    -fx-background-color: #f5f5f7;
    -fx-border-radius: 0;
    -fx-background-radius: 0;
}

.tab-pane .tab-header-area {
    -fx-background-color: #f5f5f7;
    -fx-padding: 8 8 0 8;
}

.tab-pane .tab-content-area {
    -fx-background-color: #f5f5f7;
}

.tab {
    -fx-background-color: transparent;
    -fx-background-radius: 6 6 0 0;
    -fx-border-radius: 6 6 0 0;
    -fx-padding: 8 16 8 16;
}

.tab:selected {
    -fx-background-color: #ffffff;
}

.tab:hover {
    -fx-background-color: #e8e8ed;
}

.tab .tab-label {
    -fx-text-fill: #3c3c3c;
}

/* ============================================
   扁平化表格
   ============================================ */
.table-view {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
}

.table-view .column-header {
    -fx-background-color: #f5f5f7;
    -fx-text-fill: #3c3c3c;
    -fx-font-weight: 600;
    -fx-border-color: #d2d2d7;
}

.table-row-cell {
    -fx-background-color: transparent;
    -fx-border-color: transparent;
}

.table-row-cell:hover {
    -fx-background-color: #f5f5f7;
}

.table-row-cell:selected {
    -fx-background-color: #007aff;
    -fx-text-fill: white;
}

/* ============================================
   扁平化进度条
   ============================================ */
.progress-bar {
    -fx-background-radius: 4;
    -fx-background-color: #e8e8ed;
}

.progress-bar .bar {
    -fx-background-color: #007aff;
    -fx-background-radius: 4;
    -fx-background-insets: 0;
}

/* ============================================
   扁平化滚动条
   ============================================ */
.scroll-bar {
    -fx-background-color: transparent;
}

.scroll-bar .thumb {
    -fx-background-color: #c7c7cc;
    -fx-background-radius: 4;
}

.scroll-bar .thumb:hover {
    -fx-background-color: #aeaeb2;
}

.scroll-bar .track {
    -fx-background-color: transparent;
}

/* ============================================
   工具栏
   ============================================ */
.tool-bar {
    -fx-background-color: #ffffff;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 0 0 1 0;
    -fx-padding: 8;
    -fx-spacing: 8;
}

/* ============================================
   分隔符
   ============================================ */
.separator {
    -fx-background-color: #d2d2d7;
}

/* ============================================
   标签和文本
   ============================================ */
.label {
    -fx-text-fill: #3c3c3c;
}

.label:disabled {
    -fx-text-fill: #999999;
}

/* ============================================
   对话框
   ============================================ */
.dialog-pane {
    -fx-background-color: #ffffff !important;
    -fx-background-radius: 12;
    -fx-border-radius: 12;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-effect: dropshadow(gaussian, rgb(0,0,0), 20, 0.1, 0, 5);
}

.dialog-pane > .content {
    -fx-background-color: #ffffff !important;
    -fx-padding: 20;
}

.dialog-pane .content {
    -fx-background-color: #ffffff !important;
}

.dialog-pane > .header-panel {
    -fx-background-color: #ffffff !important;
    -fx-background-radius: 12 12 0 0;
    -fx-padding: 16;
    -fx-border-color: transparent;
}

.dialog-pane > .button-bar {
    -fx-background-color: #ffffff !important;
    -fx-background-radius: 0 0 12 12;
    -fx-padding: 12 16 16 16;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1 0 0 0;
}

/* 对话框内标签的默认样式 - 使用较低优先级 */
.dialog-pane .label {
    -fx-background-color: transparent;
}

/* 对话框内标签的文字颜色 - 不覆盖自定义样式类 */
.dialog-pane > .content .label:not([class*="exception-"]) {
    -fx-text-fill: #3c3c3c;
}

/* Alert对话框特殊处理 */
.alert.dialog-pane {
    -fx-background-color: #ffffff !important;
}

.alert.dialog-pane > .content.label {
    -fx-background-color: #ffffff !important;
}

.alert .content {
    -fx-background-color: #ffffff !important;
}

.alert > .content {
    -fx-background-color: #ffffff !important;
}

/* 处理所有可能的内容包装器 */
.dialog-pane .graphic-container {
    -fx-background-color: #ffffff !important;
}

.dialog-pane > .expandable-content {
    -fx-background-color: #ffffff !important;
}

.dialog-pane .header-panel .label {
    -fx-font-size: 15px;
    -fx-font-weight: 600;
    -fx-text-fill: #3c3c3c;
}

/* ============================================
   下拉框
   ============================================ */
.combo-box {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
}

.combo-box-base {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
}

.combo-box:focused, .combo-box-base:focused {
    -fx-border-color: #007aff;
    -fx-border-width: 2;
}

.combo-box .list-cell {
    -fx-text-fill: #3c3c3c;
}

/* 下拉框弹出列表中的选中项 */
.combo-box-popup .list-view .list-cell:selected {
    -fx-background-color: #007aff !important;
    -fx-text-fill: white !important;
}

.combo-box-popup .list-view .list-cell:filled:selected {
    -fx-background-color: #007aff !important;
    -fx-text-fill: white !important;
}

.combo-box-popup .list-view .list-cell:selected .text {
    -fx-fill: white !important;
}

.combo-box-popup .list-view .list-cell:hover {
    -fx-background-color: #f5f5f7;
    -fx-text-fill: #3c3c3c;
}

/* 确保下拉框弹出列表中选中项的标签也是白色 */
.combo-box-popup .list-view .list-cell:selected .label {
    -fx-text-fill: white !important;
}

/* 下拉框本身显示的当前值 */
.combo-box .text {
    -fx-fill: #3c3c3c;
}

.combo-box:showing .text {
    -fx-fill: #3c3c3c;
}

/* 下拉框按钮区域的ListCell */
.combo-box-base .list-cell {
    -fx-background-color: transparent;
    -fx-text-fill: #3c3c3c;
}

.combo-box-base:focused .list-cell {
    -fx-background-color: transparent;
    -fx-text-fill: #3c3c3c;
}

/* ============================================
   复选框和单选框
   ============================================ */
.check-box, .radio-button {
    -fx-text-fill: #3c3c3c;
}

.check-box .box, .radio-button .radio {
    -fx-background-color: #ffffff;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-border-radius: 4;
}

.check-box:selected .box {
    -fx-background-color: #007aff;
    -fx-border-color: #007aff;
}

.check-box:selected .mark {
    -fx-background-color: white;
}

.radio-button:selected .radio {
    -fx-background-color: #007aff;
    -fx-border-color: #007aff;
}

.radio-button:selected .dot {
    -fx-background-color: white;
}

/* ============================================
   菜单
   ============================================ */
.menu-bar {
    -fx-background-color: #ffffff;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 0 0 1 0;
}

.menu {
    -fx-text-fill: #3c3c3c;
}

.menu-item {
    -fx-background-color: #ffffff;
}

.menu-item:focused, .menu-item:hover {
    -fx-background-color: #f5f5f7;
}

.menu-item .label {
    -fx-text-fill: #3c3c3c;
}

.context-menu {
    -fx-background-color: #ffffff;
    -fx-background-radius: 8;
    -fx-border-radius: 8;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-effect: dropshadow(gaussian, rgb(0,0,0), 10, 0.1, 0, 2);
}

/* ============================================
   任务进度对话框样式
   ============================================ */
.task-progress-item {
    -fx-border-color: #ddd;
    -fx-border-width: 1;
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-background-color: white;
    -fx-spacing: 8;
    -fx-padding: 10;
}

.task-progress-title {
    -fx-font-weight: 600;
    -fx-font-size: 13px;
    -fx-text-fill: #3c3c3c;
}

.task-progress-status {
    -fx-font-size: 12px;
}

.task-progress-speed {
    -fx-font-size: 11px;
    -fx-text-fill: #666;
}

/* 加载指示器样式 */
.loading-box {
    -fx-background-color: rgba(255, 255, 255, 0.9);
}

.loading-label {
    -fx-font-size: 14px;
    -fx-text-fill: #3c3c3c;
}

/* ============================================
   导航栏和工具栏样式
   ============================================ */
.navigation-bar {
    -fx-border-color: #d2d2d7;
    -fx-border-width: 0 0 1 0;
    -fx-background-color: #f5f5f7;
}

.toolbar {
    -fx-border-color: #d2d2d7;
    -fx-border-width: 0 0 1 0;
    -fx-background-color: #f5f5f7;
}

.path-label {
    -fx-font-family: "SF Mono", "Consolas", "Monaco", "Menlo", "Courier New", monospace;
    -fx-padding: 5px 8px;
    -fx-background-color: #ffffff;
    -fx-border-color: #d2d2d7;
    -fx-border-width: 1;
    -fx-border-radius: 4;
}

/* ============================================
   异常对话框样式
   ============================================ */
.exception-stacktrace {
    -fx-font-family: "Monaco", "Menlo", "Consolas", "Courier New", monospace;
    -fx-font-size: 11px;
}

/* 异常列表标签 - 直接样式，最高优先级 */
Label.exception-count-label {
    -fx-font-weight: bold;
    -fx-text-fill: #3c3c3c !important;
}

Label.exception-hint-label {
    -fx-text-fill: #666666 !important;
    -fx-font-size: 11px;
}

/* ListView 内部的异常标签样式 - 增强层次感 */
.list-view .list-cell .label.exception-title-label {
    -fx-font-weight: 600;
    -fx-text-fill: #2c2c2c !important;
    -fx-font-size: 14px !important;
}

.list-view .list-cell .label.exception-message-label {
    -fx-font-weight: normal;
    -fx-text-fill: #6c6c6c !important;
    -fx-font-size: 13px !important;
}

.list-view .list-cell .label.exception-time-label {
    -fx-text-fill: #888888 !important;
    -fx-font-size: 12px !important;
}

/* ListView 内部的选中状态样式 - 更高优先级 */
.list-view .list-cell .exception-item-selected {
    -fx-background-color: #007aff !important;
    -fx-background-radius: 4 !important;
}

.list-view .list-cell .exception-item-selected .label.exception-title-label {
    -fx-font-weight: 600 !important;
    -fx-text-fill: #ffffff !important;
}

.list-view .list-cell .exception-item-selected .label.exception-message-label {
    -fx-text-fill: #ffffff !important;
}

.list-view .list-cell .exception-item-selected .label.exception-time-label {
    -fx-text-fill: #ffffff !important;
}

/* 通用的异常标签样式（备用） */
Label.exception-title-label {
    -fx-font-weight: bold;
    -fx-text-fill: #e60000 !important;
}

Label.exception-message-label {
    -fx-text-fill: #3c3c3c !important;
}

Label.exception-time-label {
    -fx-text-fill: #888888 !important;
}

/* 选中状态的异常项容器 - 设置蓝色背景 */
.exception-item-selected {
    -fx-background-color: #007aff;
    -fx-background-radius: 4;
}

/* 选中状态的异常项 - 使用类型选择器提高优先级 */
.exception-item-selected Label.exception-time-label {
    -fx-text-fill: white !important;
}

.exception-item-selected Label.exception-message-label {
    -fx-text-fill: white !important;
}

.exception-item-selected Label.exception-title-label {
    -fx-font-weight: bold;
    -fx-text-fill: #ffffff !important;
}

/* 未选中状态的异常项 */
.exception-item Label.exception-time-label {
    -fx-text-fill: #888888 !important;
}

.exception-item Label.exception-message-label {
    -fx-text-fill: #3c3c3c !important;
}

.exception-item Label.exception-title-label {
    -fx-font-weight: bold;
    -fx-text-fill: #e60000 !important;
}

/* ============================================
   通知样式
   ============================================ */
.notification-success {
    -fx-background-color: #d4edda;
    -fx-border-color: #c3e6cb;
    -fx-text-fill: #155724;
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-font-size: 12px;
}

.notification-info {
    -fx-background-color: #d1ecf1;
    -fx-border-color: #bee5eb;
    -fx-text-fill: #0c5460;
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-font-size: 12px;
}

.notification-warning {
    -fx-background-color: #fff3cd;
    -fx-border-color: #ffeaa7;
    -fx-text-fill: #856404;
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-font-size: 12px;
}

.notification-error {
    -fx-background-color: #f8d7da;
    -fx-border-color: #f5c6cb;
    -fx-text-fill: #721c24;
    -fx-border-radius: 5;
    -fx-background-radius: 5;
    -fx-font-size: 12px;
}

/* ============================================
   对话框内容样式
   ============================================ */
.dialog-content-white {
    -fx-background-color: white;
    -fx-background-radius: 0;
}

.dialog-pane-white {
    -fx-background-color: white;
}

/* ============================================
   状态栏错误按钮
   ============================================ */
.error-button {
    -fx-font-size: 11px;
    -fx-text-fill: #d32f2f;
    -fx-background-color: transparent;
    -fx-border-color: #d32f2f;
    -fx-border-width: 1;
    -fx-border-radius: 3;
    -fx-background-radius: 3;
    -fx-padding: 2 8 2 8;
    -fx-cursor: hand;
}

.error-button:hover {
    -fx-background-color: rgba(211, 47, 47, 0.1);
}

